﻿
namespace TelecoSystems.Web.Models
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data.Objects.DataClasses;
    using System.Linq;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
    using System.ServiceModel.DomainServices;

    // The MetadataTypeAttribute identifies TargetGroupMetadata as the class
    // that carries additional metadata for the TargetGroup class.
    [MetadataTypeAttribute(typeof(TargetGroup.TargetGroupMetadata))]
    public partial class TargetGroup
    {

        // This class allows you to attach custom attributes to properties
        // of the TargetGroup class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class TargetGroupMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private TargetGroupMetadata()
            {
            }

            [Display(AutoGenerateField = false)]
            public int Id { get; set; }

            [Display(Name="Target group")]
            public string Name { get; set; }
        }
    }

    // The MetadataTypeAttribute identifies VariantMetadata as the class
    // that carries additional metadata for the Variant class.
    [MetadataTypeAttribute(typeof(Variant.VariantMetadata))]
    public partial class Variant
    {

        // This class allows you to attach custom attributes to properties
        // of the Variant class.
        //
        // For example, the following marks the Xyz property as a
        // required property and specifies the format for valid values:
        //    [Required]
        //    [RegularExpression("[A-Z][A-Za-z0-9]*")]
        //    [StringLength(32)]
        //    public string Xyz { get; set; }
        internal sealed class VariantMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private VariantMetadata()
            {
            }
            
            [Display(AutoGenerateField = false)]
            public EntityCollection<Contract> Contracts { get; set; }

            [Editable(false)]
            [Display(Name = "Created", Description = "Date when the record was created.")]
            public DateTime DateCreated { get; set; }

            [Editable(false)]
            [Display(Name = "Modified", Description = "Date of the last modification.")]
            public DateTime DateLastModified { get; set; }

            [Required]
            [StringLength(255)]
            public string Description { get; set; }

            [Display(AutoGenerateField = false)]
            public int Id { get; set; }

            [Display(Name = "Is in sale", Description = "Represents whether the variant could be offered to customers.")]
            public bool IsInSale { get; set; }

            [Required]
            [StringLength(30)]
            public string Name { get; set; }
            
            [Required]            
            public double Price { get; set; }

            [Display(AutoGenerateField = false)]
            public Product Product { get; set; }

            [Required]
            [Display(AutoGenerateField=false)]
            public int ProductID { get; set; }
            
            [Include]            
            public TargetGroup TargetGroup { get; set; }
            
            [Required]
            [Display(AutoGenerateField = false)]
            public int TargetGroupId { get; set; }
        }
    }
}
